<!--
 * @Descripttion: 
 * @version: 
 * @Author: wtzhang
 * @Date: 2021-08-05 13:15:06
 * @LastEditors: wtzhang
 * @LastEditTime: 2021-08-06 14:25:16
-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app"></div>
  <script src="../js/old_version/react.development.js"></script>
  <script src="../js/old_version/react-dom.development.js"></script>
  <script src="../js/old_version/babel.min.js"></script>
  <script type="text/babel">
    // 创建虚拟dom, 类组件式
    class Person extends React.Component {
      render() {
        console.log(this);
        const {name, age, sex} = this.props
        return (
        <ul>
          <li>{this.props.name}</li>
          <li>{this.props.age}</li>
          <li>{this.props.sex}</li>
          <hr/>
          <li>{name}</li>
          <li>{age}</li>
          <li>{sex}</li>
        </ul>
        )
      }
    }
    // 渲染到页面
    // ReactDOM.render(虚拟DOM, 容器)
    // ReactDOM.render(<Person name="jack" age={18}" />, document.getElementById('app'))
    // props批量传递数据（传递标签属性）
    let obj = {name: 'jack', age: 18, sex: 'male'}
    // ReactDOM.render(虚拟DOM, 容器)
    ReactDOM.render(<Person {...obj}/>, document.getElementById('app'))
  </script>
</body>
</html>